
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>common · 驱动管理</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="Gj">
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-chapter-fold/chapter-fold.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search-pro/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-prism/prism-tomorrow.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
        <link rel="stylesheet" href="../styles/website.css">
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="components.html" />
    
    
    <link rel="prev" href="api.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    概要
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../Framework.html">
            
                <a href="../Framework.html">
            
                    
                    架构
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">src目录</li>
        
        
    
        <li class="chapter " data-level="2.1" data-path="api.html">
            
                <a href="api.html">
            
                    
                    api
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="2.2" data-path="common.html">
            
                <a href="common.html">
            
                    
                    common
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.3" data-path="components.html">
            
                <a href="components.html">
            
                    
                    components
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.4" data-path="filters.html">
            
                <a href="filters.html">
            
                    
                    filters
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.5" data-path="layout.html">
            
                <a href="layout.html">
            
                    
                    layout
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.6" data-path="mixins.html">
            
                <a href="mixins.html">
            
                    
                    mixins
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.7" data-path="model.html">
            
                <a href="model.html">
            
                    
                    model
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.8" data-path="router.html">
            
                <a href="router.html">
            
                    
                    router
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.9" data-path="store.html">
            
                <a href="store.html">
            
                    
                    store
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.10" data-path="styles.html">
            
                <a href="styles.html">
            
                    
                    styles
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.11" data-path="types.html">
            
                <a href="types.html">
            
                    
                    types
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.12" data-path="utils.html">
            
                <a href="utils.html">
            
                    
                    utils
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.13" data-path="views/">
            
                <a href="views/">
            
                    
                    views
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.13.1" data-path="views/init.html">
            
                <a href="views/init.html">
            
                    
                    init
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.13.2" data-path="views/login.html">
            
                <a href="views/login.html">
            
                    
                    login
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.13.3" data-path="views/drive.html">
            
                <a href="views/drive.html">
            
                    
                    drive
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.13.4" data-path="views/logs.html">
            
                <a href="views/logs.html">
            
                    
                    logs
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.13.5" data-path="views/strategy.html">
            
                <a href="views/strategy.html">
            
                    
                    strategy
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.14" data-path="config.html">
            
                <a href="config.html">
            
                    
                    配置文件
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >common</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h3 id="&#x516C;&#x5171;&#x5305;">&#x516C;&#x5171;&#x5305;</h3>
<blockquote>
<p>&#x516C;&#x5171;&#x5305; &#x62E6;&#x622A;&#x5668;&#x3001;api&#x8BF7;&#x6C42;&#x5DE5;&#x5177;&#x3001;ant&#x6309;&#x9700;&#x52A0;&#x8F7D;&#x96C6;&#x7B49;</p>
</blockquote>
<h5 id="frame">frame</h5>
<p>&#x8003;&#x8651;&#x6027;&#x80FD;&#x539F;&#x56E0;&#xFF0C;<em>ant-design-vue</em> &#x7EC4;&#x4EF6;&#x6309;&#x9700;&#x52A0;&#x8F7D;&#x6587;&#x4EF6;&#x3002;&#x5982;&#x679C;&#x5E0C;&#x671B;&#x7528;&#x5176;&#x4ED6;&#x529F;&#x80FD;&#xFF0C;&#x53EA;&#x9700;&#x8981;&#x5728; <em>components-ant.ts</em>&#x6587;&#x4EF6;&#x91CC;&#x914D;&#x7F6E;&#x3002;</p>
<pre class="language-"><code class="lang-typescript"><span class="token keyword">import</span> Vue <span class="token keyword">from</span> <span class="token string">&apos;vue&apos;</span>
<span class="token keyword">import</span> Ant <span class="token keyword">from</span> <span class="token string">&apos;ant-design-vue&apos;</span>
<span class="token operator">...</span>

Vue<span class="token punctuation">.</span><span class="token function">use</span><span class="token punctuation">(</span>LocaleProvider<span class="token punctuation">)</span>
Vue<span class="token punctuation">.</span><span class="token function">use</span><span class="token punctuation">(</span>Pagination<span class="token punctuation">)</span>
Vue<span class="token punctuation">.</span><span class="token function">use</span><span class="token punctuation">(</span>Layout<span class="token punctuation">)</span>
Vue<span class="token punctuation">.</span><span class="token function">use</span><span class="token punctuation">(</span>Input<span class="token punctuation">)</span>
Vue<span class="token punctuation">.</span><span class="token function">use</span><span class="token punctuation">(</span>InputNumber<span class="token punctuation">)</span>
Vue<span class="token punctuation">.</span><span class="token function">use</span><span class="token punctuation">(</span>Button<span class="token punctuation">)</span>
<span class="token operator">...</span>

<span class="token class-name">Vue</span><span class="token punctuation">.</span>prototype<span class="token punctuation">.</span>$confirm <span class="token operator">=</span> Modal<span class="token punctuation">.</span>confirm
<span class="token operator">...</span>
</code></pre>
<h5 id="antselectconfigts">AntSelectConfig.ts</h5>
<p>&#x4E0B;&#x62C9;&#x6846;&#x9759;&#x6001;&#x6570;&#x636E;&#x7EDF;&#x4E00;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x3002;</p>
<pre class="language-"><code class="lang-typescript"><span class="token keyword">export</span> <span class="token keyword">const</span> selectColumns <span class="token operator">=</span> <span class="token punctuation">{</span>
  driverType<span class="token operator">:</span> <span class="token punctuation">[</span>
    <span class="token punctuation">{</span>
      label<span class="token operator">:</span> <span class="token string">&quot;&#x76F4;&#x6253;&quot;</span><span class="token punctuation">,</span>
      value<span class="token operator">:</span> direct
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token punctuation">{</span>
      label<span class="token operator">:</span> <span class="token string">&quot;&#x6F2B;&#x6E38;&quot;</span><span class="token punctuation">,</span>
      value<span class="token operator">:</span> roaming
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token punctuation">{</span>
      label<span class="token operator">:</span> <span class="token string">&quot;&#x5176;&#x4ED6;&quot;</span><span class="token punctuation">,</span>
      value<span class="token operator">:</span> other
    <span class="token punctuation">}</span>
  <span class="token punctuation">]</span><span class="token punctuation">,</span>
  <span class="token operator">...</span>
<span class="token punctuation">}</span>
</code></pre>
<h5 id="enum2valts">Enum2Val.ts</h5>
<p>&#x679A;&#x4E3E;&#x7C7B;&#x578B;&#x5BF9;&#x5E94;&#x7ED3;&#x679C;&#x96C6;</p>
<pre class="language-"><code class="lang-typescript"><span class="token keyword">import</span> <span class="token punctuation">{</span> OsType<span class="token punctuation">,</span> DriverType<span class="token punctuation">,</span> CpuBits<span class="token punctuation">,</span> UpgradeResult <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">&quot;@/utils/VEnum&quot;</span><span class="token punctuation">;</span>
<span class="token operator">...</span>

<span class="token comment">/* &#x5347;&#x7EA7;&#x7ED3;&#x679C; */</span>
<span class="token keyword">export</span> <span class="token keyword">const</span> Result2Val<span class="token operator">:</span> <span class="token builtin">any</span> <span class="token operator">=</span> <span class="token punctuation">{</span>
  <span class="token punctuation">[</span>UpgradeResult<span class="token punctuation">.</span>Error<span class="token punctuation">]</span><span class="token operator">:</span> <span class="token string">&quot;&#x5931;&#x8D25;&quot;</span><span class="token punctuation">,</span>
  <span class="token punctuation">[</span>UpgradeResult<span class="token punctuation">.</span>Success<span class="token punctuation">]</span><span class="token operator">:</span> <span class="token string">&quot;&#x6210;&#x529F;&quot;</span>
<span class="token punctuation">}</span><span class="token punctuation">;</span>
<span class="token operator">...</span>
</code></pre>
<h5 id="formitemlayoutts">FormItemLayout.ts</h5>
<p>ant&#x8868;&#x5355;&#x7EC4;&#x4EF6;&#x7EDF;&#x4E00;&#x6837;&#x5F0F;&#x914D;&#x7F6E;&#xFF08;&#x6B64;&#x5904;&#x4E5F;&#x662F;&#x8003;&#x8651;ant&#x9ED8;&#x8BA4;&#x914D;&#x7F6E;&#x6837;&#x5F0F;&#x7684;&#x683C;&#x5F0F;&#x6BD4;&#x8F83;&#x4E11;&#x964B;&#xFF0C;&#x800C;&#x4E14;&#x5F88;&#x591A;&#x5730;&#x65B9;&#x91CD;&#x590D;&#x5B9A;&#x4E49;&#x3002;&#xFF09;</p>
<pre class="language-"><code class="lang-typescript"><span class="token keyword">export</span> <span class="token keyword">default</span> <span class="token punctuation">{</span>
  labelCol<span class="token operator">:</span> <span class="token punctuation">{</span>
    xs<span class="token operator">:</span> <span class="token punctuation">{</span> span<span class="token operator">:</span> <span class="token number">24</span> <span class="token punctuation">}</span><span class="token punctuation">,</span>
    sm<span class="token operator">:</span> <span class="token punctuation">{</span> span<span class="token operator">:</span> <span class="token number">5</span> <span class="token punctuation">}</span>
  <span class="token punctuation">}</span><span class="token punctuation">,</span>
  wrapperCol<span class="token operator">:</span> <span class="token punctuation">{</span>
    xs<span class="token operator">:</span> <span class="token punctuation">{</span> span<span class="token operator">:</span> <span class="token number">24</span> <span class="token punctuation">}</span><span class="token punctuation">,</span>
    sm<span class="token operator">:</span> <span class="token punctuation">{</span> span<span class="token operator">:</span> <span class="token number">16</span> <span class="token punctuation">}</span>
  <span class="token punctuation">}</span>
<span class="token punctuation">}</span><span class="token punctuation">;</span>
</code></pre>
<h5 id="interceptorts">interceptor.ts</h5>
<p>&#x5168;&#x5C40;&#x62E6;&#x622A;&#x5668;&#xFF0C;&#x601D;&#x8DEF;&#x548C; <em>&#x5408;&#x540C;&#x7BA1;&#x7406;&#x4E00;&#x6837;</em></p>
<pre class="language-"><code class="lang-typescript"><span class="token keyword">import</span> router <span class="token keyword">from</span> <span class="token string">&quot;@/router&quot;</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> NProgress <span class="token keyword">from</span> <span class="token string">&quot;nprogress&quot;</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token string">&quot;nprogress/nprogress.css&quot;</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token punctuation">{</span> Route <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">&quot;vue-router&quot;</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token punctuation">{</span> getModule <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">&quot;vuex-module-decorators&quot;</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> User <span class="token keyword">from</span> <span class="token string">&quot;@/store/modules/user&quot;</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> Store <span class="token keyword">from</span> <span class="token string">&quot;@/store&quot;</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token punctuation">{</span> RouterPath <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">&quot;@/utils/VEnum&quot;</span><span class="token punctuation">;</span>

NProgress<span class="token punctuation">.</span><span class="token function">configure</span><span class="token punctuation">(</span><span class="token punctuation">{</span> showSpinner<span class="token operator">:</span> <span class="token boolean">false</span> <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>

<span class="token keyword">const</span> whiteList <span class="token operator">=</span> <span class="token punctuation">[</span>
  RouterPath<span class="token punctuation">.</span>Login<span class="token punctuation">.</span><span class="token function">toString</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
  RouterPath<span class="token punctuation">.</span>InitAdmin<span class="token punctuation">.</span><span class="token function">toString</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
<span class="token punctuation">]</span><span class="token punctuation">;</span>

<span class="token keyword">const</span> UserModule <span class="token operator">=</span> <span class="token function">getModule</span><span class="token punctuation">(</span>User<span class="token punctuation">,</span> Store<span class="token punctuation">)</span><span class="token punctuation">;</span>

router<span class="token punctuation">.</span><span class="token function">beforeEach</span><span class="token punctuation">(</span><span class="token keyword">async</span> <span class="token punctuation">(</span><span class="token parameter">to<span class="token operator">:</span> Route<span class="token punctuation">,</span> _<span class="token operator">:</span> Route<span class="token punctuation">,</span> next<span class="token operator">:</span> <span class="token builtin">any</span></span><span class="token punctuation">)</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{</span>
  NProgress<span class="token punctuation">.</span><span class="token function">start</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
  <span class="token keyword">if</span> <span class="token punctuation">(</span>UserModule<span class="token punctuation">.</span>token<span class="token punctuation">)</span> <span class="token punctuation">{</span>
    <span class="token keyword">if</span> <span class="token punctuation">(</span>to<span class="token punctuation">.</span>path <span class="token operator">===</span> RouterPath<span class="token punctuation">.</span>Login<span class="token punctuation">)</span> <span class="token punctuation">{</span>
      <span class="token function">next</span><span class="token punctuation">(</span><span class="token punctuation">{</span> path<span class="token operator">:</span> RouterPath<span class="token punctuation">.</span>Home <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
      NProgress<span class="token punctuation">.</span><span class="token function">done</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span> <span class="token keyword">else</span> <span class="token punctuation">{</span>
      <span class="token function">next</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span>
  <span class="token punctuation">}</span> <span class="token keyword">else</span> <span class="token punctuation">{</span>
    <span class="token keyword">if</span> <span class="token punctuation">(</span>whiteList<span class="token punctuation">.</span><span class="token function">includes</span><span class="token punctuation">(</span>to<span class="token punctuation">.</span>path<span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
      <span class="token function">next</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span> <span class="token keyword">else</span> <span class="token punctuation">{</span>
      <span class="token function">next</span><span class="token punctuation">(</span>RouterPath<span class="token punctuation">.</span>Login<span class="token punctuation">)</span><span class="token punctuation">;</span>
      NProgress<span class="token punctuation">.</span><span class="token function">done</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span>
  <span class="token punctuation">}</span>
<span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>

router<span class="token punctuation">.</span><span class="token function">afterEach</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token parameter">to<span class="token operator">:</span> Route</span><span class="token punctuation">)</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{</span>
  NProgress<span class="token punctuation">.</span><span class="token function">done</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre>
<h5 id="requestts">request.ts</h5>
<p>api&#x8BF7;&#x6C42;&#x5DE5;&#x5177;&#x3002;&#x63A5;&#x53E3;&#x5F02;&#x5E38;&#x62E6;&#x622A;&#x3002;</p>
<pre class="language-"><code class="lang-typescript"><span class="token keyword">import</span> axios <span class="token keyword">from</span> <span class="token string">&quot;axios&quot;</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> Ant <span class="token keyword">from</span> <span class="token string">&quot;ant-design-vue&quot;</span><span class="token punctuation">;</span>
<span class="token keyword">const</span> <span class="token punctuation">{</span> message <span class="token punctuation">}</span> <span class="token operator">=</span> Ant<span class="token punctuation">;</span>
<span class="token keyword">import</span> Error <span class="token keyword">from</span> <span class="token string">&quot;@/utils/Error&quot;</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token punctuation">{</span> LocalStorage <span class="token keyword">as</span> LocalEnum <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">&quot;@/utils/VEnum&quot;</span><span class="token punctuation">;</span>

<span class="token keyword">const</span> service <span class="token operator">=</span> axios<span class="token punctuation">.</span><span class="token function">create</span><span class="token punctuation">(</span><span class="token punctuation">{</span>
  timeout<span class="token operator">:</span> <span class="token number">5000</span>
<span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>

<span class="token comment">// request interceptor</span>
service<span class="token punctuation">.</span>interceptors<span class="token punctuation">.</span>request<span class="token punctuation">.</span><span class="token function">use</span><span class="token punctuation">(</span>
  <span class="token parameter">config</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{</span>
    <span class="token comment">// Do something before request is sent</span>
    <span class="token keyword">const</span> token <span class="token operator">=</span> localStorage<span class="token punctuation">.</span><span class="token function">getItem</span><span class="token punctuation">(</span>LocalEnum<span class="token punctuation">.</span>token<span class="token punctuation">.</span><span class="token function">toString</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token operator">||</span> <span class="token string">&quot;&quot;</span><span class="token punctuation">;</span>
    <span class="token keyword">if</span> <span class="token punctuation">(</span>token<span class="token punctuation">)</span> <span class="token punctuation">{</span>
      config<span class="token punctuation">.</span>headers<span class="token punctuation">[</span><span class="token string">&quot;token&quot;</span><span class="token punctuation">]</span> <span class="token operator">=</span> token<span class="token punctuation">;</span>
    <span class="token punctuation">}</span>
    <span class="token keyword">return</span> config<span class="token punctuation">;</span>
  <span class="token punctuation">}</span><span class="token punctuation">,</span>
  <span class="token parameter">error</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{</span>
    <span class="token builtin">Promise</span><span class="token punctuation">.</span><span class="token function">reject</span><span class="token punctuation">(</span>error<span class="token punctuation">)</span><span class="token punctuation">;</span>
  <span class="token punctuation">}</span>
<span class="token punctuation">)</span><span class="token punctuation">;</span>

<span class="token comment">// response interceptor</span>
service<span class="token punctuation">.</span>interceptors<span class="token punctuation">.</span>response<span class="token punctuation">.</span><span class="token function">use</span><span class="token punctuation">(</span>
  <span class="token parameter">response</span> <span class="token operator">=&gt;</span> response<span class="token punctuation">,</span>
  <span class="token parameter">error</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{</span>
    <span class="token keyword">const</span> <span class="token punctuation">{</span> status <span class="token punctuation">}</span> <span class="token operator">=</span> error<span class="token punctuation">.</span>response<span class="token punctuation">;</span>
    <span class="token keyword">const</span> <span class="token punctuation">{</span> errNo<span class="token punctuation">,</span> msg <span class="token punctuation">}</span> <span class="token operator">=</span> error<span class="token punctuation">.</span>response<span class="token punctuation">.</span>data<span class="token punctuation">;</span>
    <span class="token keyword">const</span> err<span class="token operator">:</span> <span class="token builtin">any</span> <span class="token operator">=</span> Error<span class="token punctuation">;</span>
    message<span class="token punctuation">.</span><span class="token function">error</span><span class="token punctuation">(</span>err<span class="token punctuation">[</span>errNo<span class="token punctuation">]</span> <span class="token operator">||</span> <span class="token string">&quot;&#x7CFB;&#x7EDF;&#x5F02;&#x5E38;&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token keyword">return</span> <span class="token builtin">Promise</span><span class="token punctuation">.</span><span class="token function">reject</span><span class="token punctuation">(</span>error<span class="token punctuation">.</span>response<span class="token punctuation">.</span>data<span class="token punctuation">)</span><span class="token punctuation">;</span>
  <span class="token punctuation">}</span>
<span class="token punctuation">)</span><span class="token punctuation">;</span>

<span class="token keyword">export</span> <span class="token keyword">default</span> service<span class="token punctuation">;</span>
</code></pre>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="api.html" class="navigation navigation-prev " aria-label="Previous page: api">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="components.html" class="navigation navigation-next " aria-label="Next page: components">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"common","level":"2.2","depth":1,"next":{"title":"components","level":"2.3","depth":1,"path":"src/components.md","ref":"src/components.md","articles":[]},"previous":{"title":"api","level":"2.1","depth":1,"path":"src/api.md","ref":"src/api.md","articles":[]},"dir":"ltr"},"config":{"plugins":["chapter-fold","-lunr","-search","search-pro","-highlight","prism"],"styles":{"website":"styles/website.css"},"pluginsConfig":{"prism":{"css":["prismjs/themes/prism-tomorrow.css"]},"chapter-fold":{},"search-pro":{},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"Gj","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"驱动管理","language":"zh-hans","gitbook":"3.2.3","description":"驱动管理Web端"},"file":{"path":"src/common.md","mtime":"2020-02-24T03:16:59.512Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2020-03-03T02:33:20.679Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-chapter-fold/chapter-fold.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search-pro/jquery.mark.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search-pro/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

